package schoolword;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串: ");
        String str = sc.nextLine();
       if(isHuiwen(str)) {
           System.out.println(str + "对称字符串");
       }else {
           System.out.println(str + "不是对称字符串");
       }

    }
    public static boolean isHuiwen (String str) {
        StringBuffer stringBuffer = new StringBuffer(str);
        String reversStr = stringBuffer.reverse().toString();
        return str.equals(reversStr);  //判断是否相同
    }
}
